﻿using System.Windows;
using Microsoft.Phone.Controls;

namespace WindowsPhoneMVC.Framework
{
    public static class Page
    {
        public static readonly DependencyProperty IsMemoryEfficientProperty =
            DependencyProperty.RegisterAttached("IsMemoryEfficient", typeof(bool?), typeof(Page), new PropertyMetadata(null));

        public static void SetIsMemoryEfficient(PhoneApplicationPage page, bool? value)
        {
            page.SetValue(IsMemoryEfficientProperty, value);
        }

        public static bool? GetIsMemoryEfficient(PhoneApplicationPage page)
        {
            return (bool) page.GetValue(IsMemoryEfficientProperty);
        }
    }
}